package git.soulbgm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import git.soulbgm.config.SysConfig;
import git.soulbgm.pojo.NetworkEquipmentStatus;
import git.soulbgm.mapper.NetworkEquipmentStatusMapper;
import git.soulbgm.pojo.NodeInfo;
import git.soulbgm.service.NetworkEquipmentStatusService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 网络设备状态服务实现
 *
 * @author SoulBGM
 * @date 2022-11-25
 */
@Service
public class NetworkEquipmentStatusServiceImpl extends ServiceImpl<NetworkEquipmentStatusMapper, NetworkEquipmentStatus> implements NetworkEquipmentStatusService {

    @Override
    public boolean reset(List<NetworkEquipmentStatus> list) {
        remove(new LambdaQueryWrapper<NetworkEquipmentStatus>().eq(NetworkEquipmentStatus::getRegionCode, SysConfig.getConfig().getRegionCode()));
        return saveBatch(list);
    }

}